package com.glhtgyxy.biyesheji.Service;

import com.glhtgyxy.biyesheji.Mapper.evaluateMapper;
import com.glhtgyxy.biyesheji.Pojo.evaluate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class evaluateService {

    @Autowired
    evaluateMapper mapper;

    public ArrayList<evaluate> findAllEvaluateMerchant(){
        return mapper.findAllEvaluateMerchant();
    }

    public boolean deleteMerchant(int id){
        return mapper.deleteMerchant(id)>0?true:false;
    }

    public boolean updateMerchantEva(int id,int star,String evaluate){
        return mapper.updateMerchantEva(id,star,evaluate)>0?true:false;
    }

    public boolean addEvaluate(int userid,int merchantid,int star,String evaluate){
        return mapper.addEvaluate(userid,merchantid,star,evaluate)>0?true:false;
    }

    public ArrayList<evaluate> findMerchantEva(String searchtext){
        return mapper.findMerchantEva(searchtext);
    }







}
